package com.yeskery.nut.web.demo.biz;

import com.yeskery.nut.annotation.bean.Component;
import com.yeskery.nut.annotation.scheduling.Scheduled;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;

/**
 * @author YESKERY
 * 2024/8/21
 */
@Component
public class ScheduledBiz {

    private static final Logger logger = Logger.getLogger(ScheduledBiz.class.getName());

    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss");

    @Scheduled(cron = "0/5 * * * * ?", initialDelay = 5000)
    public void log() {
        logger.info("定时调度日志输出:" + simpleDateFormat.format(new Date()));
    }
}
